Index

Welcome on String Studio 1.2!

Overview

Registration

Functions

package

Terms

Shareware?

String Studio 1.2 COPYRIGHT 1993, 1994 Denis CHEVRON - All rights reserved.

All trades Marks are deposed by their owners.

This file must not be distributed without the full String Studio 2.2 package.

THIS SOFTWARE AND DOCUMENTATION ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.

GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.  THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM.


Version, Licence and Author
Version, Registration and Author

Version

Two versions are available: The registered version and the evaluation version. The evaluation version can be freely distributed if you give the full String Studio package and you don' t modify any file.  You can find the evaluation version:

- On COMPUSERVE ( go WINSDK, or MSLANG ),

- On PsL.

With the unregistered version, you can fully test String Studio. You will see Shareware principles reminders each time you construct a new CStr string! Distributing programs made with String Studio unregistered version is forbidden!

The registered version required the evaluation version because when you register I send you, thanks to an EMail to your Compuserve ID, the CSTR.CPP file which contains all source you need to build your String Studio version. Also, to use it you need this HLP file and the evaluation version CSTR.H file.

If you' re not a Compuserve user and you don' t know anybody who are, and, in case you absolutely need the source code, you can get it on a diskette if you buy it with Zip Studio ( see below ).

Registration

At present there is one way to register String Studio (alone): Compuserve. On Compuserve, go SWREG Forum and then look for String Studio registration ID. When you are OK, you give your credit card number and then SWREG will take 35$ for your String Studio registration.

Then when I receive your contribution I send you the 'magic' CSTR.CPP source code ( as a ZIP file ).

Because there is no special passwords, I do not send any other postal invoice.

If you wish to send me an  Email, this is my address:

Denis CHEVRON

CIS ID: 100333,27

If you can' t access Compuserve, you can order it on a diskette: In such case I provide a Zip Studio 1.2 + String Studio bundle, which costs 70$- ( or 400 Francs Français if you' re french ), and is shipped on a diskette. To order this package, send a postal mail with your check and specify you wish to receive the

'Zip Studio + String Studio bundle' to:

Denis CHEVRON

102, rue de Maubeuge

75010 PARIS FRANCE

(There is no phone!)

Licence

The licence is an using authorization but not a product cession. Programs made with the unregistered version never will be distributed. To distribute your programs using String Studio, you must register to Denis CHEVRON. Then you will build ( and customize ) your own String Studio Library without the

shareware dialog box displayed when you create a new CStr object!

You can use this product on several PC but no more than one unique copy can be used at the same time.

Author and technical support

You can join the author on COMPUSERVE ( CIS: 100333,27 ): I check my mail every day.

However, there is no technical support for String Studio!

Other products

- Zip Studio 1.2

This is a powerful Zip\Unzip API for Windows 3.10. You can register with Compuserve SWREG Forum, Zip Studio ID is 2456 and it costs 55$-. If you buy this API with Setup Studio you can save $$$- ( on compuserve go SWREG, this bundle ID is 2667 and it costs 85$- ).

- Setup Studio 2.2

A powerful toolkit to create professional quality Setup programs for Windows 3.10. If you' re a MFC user, it' s perfect because I provide in this package a generic setup program with source code: You just have to change some labels! However, if you don' t understand anything or, if you don' t have time to study this soft, you can buy a ready to run setup program thanks to the new 'Setup Studio Partners' program. The toolkit costs 50$- and the registration ID on compuserve is 2455.


Package files
Files package

CSTR.LIB	String Studio static library.
CSTR.H	String studio header file.
CSTR.HLP	This file!
README.TXT	To read first.
FILE_ID.DIZ	BBS File.
DESC.SDI	BBS File.


Shareware?

String Studio is a ShareWare:

You can try it as you want before you decide or not to register. The only one way I have to sell enough licences to support this software, is to distribute it all over the world. So, if you think this product will help one of your friends, don' t hesitate to give him a copy of this product: This is your interest!

When you distribute String Studio, don' t change any file and give the complete package. If you UL String Studio on a BBS, please name it CSTR.ZIP or CSTR12.EXE.

Obviously, if you register, you can' t distribute your registered CSTR.CPP file !

Distributing programs made with String Studio unregistered version is forbidden!


Terms

Description

Used terms are C and SDK language type. If you do not program with these languages, perhaps you will have some difficulties to understand them. These are some explanations:

int	Integer value.
long	Long integer value.
UINT	Signed long integer value.
BOOL	Integer value, 0 for FALSE, anything else for TRUE.
char	Character.
char far*	String.
LPSTR	String.
LPCSTR	Constant String.
HWND	Window' s Handle( Integer value ).
HINSTANCE	Application' s Handle( Integer value ).
void	Null type ( empty  ).
WINAPI	FAR PASCAL.
COLORREF	Long integer value ( Colour ).


Product overview

Why String Studio?

As you know, strings management with C language was a real problem! Of course that was quite powerful but not really useful to work with the Windows environment! Then the C++ allows programmers to create a new kind of data: The STRING!

As the MFC do, many programmers use the C++ language to build something to make new C++ strings as 'natural' as basic do. However, because I can' t find a C++ class which manages strings BETTER than a basic compiler I' ve written this one: Thanks to my CStr class you can build a powerful application without any pain and without many code. I also include functions to manage formated numbers, items management, files, times and even Windows Controls support!

That' s why I propose to share my exeperiences with C++ strings with other MFC programmers. To use my strings ( CStr ), you need to use MFC strings ( CString ) because my class is a derived class of CString. However, I think it' s easy to translate my source code to another API. Now, you just have to link with my CSTR.LIB static library file ( compiled with VC++ 1.5, large model ), and to include the CSTR.H file in your C++ files ( under the STDAFX.H ). Now replace all your CString with CStr. To have a look at all functions I support use the browser [F11] key or have a look at this HLP file.

Features?

This is the list of the 44 available CStr functions:

TRIM:	Trim, TrimBegin, TrimEnd
FIND:	Count
INPUT:	From, FromCurrentTime, FromFileTime
OUTPUT:	ToInt, ToUINT, ToLong, ToULong, ToFloat, ToDouble, ToTime
MODIFICATIONS:	Delete, Replace, Insert, Extract
IMPROVMENT:	Operator[], GetBuffer
NUMBERS:	Round, IsDigit, IsInRange
FORMAT:	FirstUpper, AddLF
MISC.:	Blank, Replicate, CheckSize, CheckDirSize
INI FILES:	FromIni, ToIni
TEXT FILES:	FromFile, ToFile
WINDOWS:	ToCtl, FromCtl, MB

Of course, all CString functions are available for CStr objects! Also, my CStr class is very easy to use because it' s similar to the CString class ( you must have enough knowledge about this class before you can work with my CStr class ), and there is one main difference with CStr: Generaly when you call a CStr function, the current CStr object ( this ) is changed.

**** Warning *****

This LIB file was compiled with VC++ 1.5 under the Windows large model using static MFC library.

You can' t use it with DOS project and others memory models!

As I give you the source code when you register, you can build a specific LIB file for DOS or another memory model...

Registration?

String Studio is not free: With the unregistered version, each time you build a new CStr ( when you call the CStr constructor ), a shareware reminder is displayed. Sorry for this cruel method, but it' s the only way I' ve found to encourage you to register!

Registration costs 35$- and is available on Compuserve SWREG, if you don' t have a Compuserve account, see the licence page. When you register through Compuserve, I send you an EMail with the CSTR.CPP source code so you can build your String Studio personnal version.

See also...

licence


Functions

How to use the CStr?

Before you can use a CStr function, you must create a CStr object ( thanks to a classic CString constructor ), then you apply the function to this object. All functions are CStr members!

Example

CStr szMyString;

szMyString.FromCtl( this, IDC_STATICTITLE );

szMyString.MB();

Description

Trim, TrimEnd, TrimBegin	Trims the current CStr.
Count	Counts substrings in the current CStr.
From	Copies data to the current CStr.
FromCurrentTime	Copies the current date/Time to the current CStr.
FromFileTime	Fills the current CStr with a file date/time.
ToInt, ToUINT, ToLong, ToULong, ToFloat, ToDouble	Copies a numerical data to the current CStr.
ToTime	Retrieves a CTime object from the current CStr.
Delete	Deletes a piece of the current CStr
Replace	Replaces all substrings in the current CStr.
Insert	Inserts a string in the current CStr.
Extract	Extracts an item of the current CStr.
operator[]	Sets a character in the current CStr.
GetBuffer	Returns a LPSTR buffer for the current CStr.
Round	Rounds the numerical value in the current CStr.
IsDigit	Tests for a numerical value in the current CStr.
IsInRange	Checks if the numerical value is in the range.
FirstUpper	Makes first character in Uppercase.
AddLF	Adds a CRLF to the current CStr.
Blank	Replaces all characters by a space.
Replicate	Creates a string for the current CStr.
CheckSize	Checks the length of the current CStr.
CheckDirSize	Checks the length of the dir in the current CStr.
FromIni	Fills the current CStr with an INI file value.
ToIni	Puts the current CStr value to an INI file.
FromFile	Loads a text file into the current CStr.
ToFile	Puts the current CStr value into a text file.
FromCtl	Retrieves the text of an Windows control.
ToCtl	Put the current CStr value in an Windows control.
MB	Display the current CStr value into an MessageBox.


Trim

CString Trim( void );

Description

Trims a string ( delete spaces and tabs ).

CHANGES THE CSTR OBJECT

Example

CStr szMyString("  ABC   ");

szMyString.Trim();

szMyString.MB();

See also...

TrimEnd

TrimBegin

Replace

FirstUpper

Blank


TrimEnd

CString TrimBegin( void );

Description

Trims the begining of a string ( delete spaces and tabs ).

CHANGES THE CSTR OBJECT

Example

CStr szMyString("  ABC   ");

szMyString.TrimBegin();

szMyString.MB();

See also...

Trim

TrimBegin

Replace

FirstUpper

Blank


TrimBegin

CString TrimEnd( void );

Description

Trims the end of a string ( delete spaces and tabs ).

CHANGES THE CSTR OBJECT

Example

CStr szMyString("  ABC   ");

szMyString.TrimEnd();

szMyString.MB();

See also...

Trim

TrimEnd

Replace

FirstUpper

Blank


Count

unsigned int Count( LPCSTR szSubString );

unsigned int Count( char szSubString );

Description

Returns the number of a char or a string in the current CStr object .

Example

CStr szMyString("ABA"), szMsg;

int a = 0;

a = szMyString.Count("A");

szMsg.From( (int)a );

szMsg.MB();


From

CString From( long data, int base = 10, LPCSTR szSeparator = ",");

CString From( unsigned long data, int base = 10, LPCSTR szSeparator = ",");

CString From( int data, int base = 10, LPCSTR szSeparator = ",");

CString From( double data, int precision = 2, LPCSTR szSeparator = ",");

CString From( CTime TimeValue, LPCSTR szFilter = "%d/%m/%y" );

Description

* From  long, unsigned long and int:

Translates a numerical value specified with <data> to a string, <base> is 10 or 16 and  <szSeparator> indicates the character to use as a thousands separator ( "," is highly recommended for translations ).

* From  double:

Translates a double value specified with <data> to a string, <precison> is the number of decimal digits and  <szSeparator> indicates the character to use as a thousands separator ( "," is highly recommended for translations ).

* From CTime:

Translates a CTime object specified with <TimeValue> to a string using <szFilter> mask. see CTime.Format for possible values for <szFilter>.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMyString("ABA"), szMsg;

int a = 0;

a = szMyString.Count("A");

szMsg.From( (int)a );

szMsg.MB();

See also...

FromCurrentTime

FromFileTime

ToInt

ToUINT

ToLong

ToULong

ToFloat

ToDouble

ToTime

IsInRange

FromIni

FromFile

FromCtl


FromCurrentTime

CString FromCurrentTime( LPCSTR szFilter = "%d/%m/%y" );

Description

Retrieves the current date/time and puts it into the current CStr object using <szFilter>.

See CTime.Format for possible values for <szFilter>.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

szMsg.FromCurrentTime();

szMsg.MB();

See also...

From

FromFileTime

ToTime

FromIni


FromFileTime

CString FromFileTime( LPCSTR szFile, LPCSTR szFilter = "%d/%m/%y" );

Description

Retrieves the file date/time specified with <szFile> and puts it into the current CStr object using <szFilter>. See CTime.Format for possible values for <szFilter>.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

szMsg.FromFileTime("C:\\WINDOWS\\WIN.INI");

szMsg.MB();

See also...

From

FromCurrentTime

ToTime

FromFile


ToInt

signed int ToInt( void );

Description

Returns the value of the current CStr object as a signed integer or 0 if CStr doesn' t correspond to a number.

Example

int iValue = 125, iTest = 0;

CStr szMsg;

szMsg.From( (int)iValue );

iTest = szMsg.ToInt();

szMsg.From( (int)iTest );

szMsg.MB();

See also...

From

ToUINT

ToLong

ToULong

ToFloat

ToDouble

ToTime

Round

IsDigit

IsInRange


ToUINT

UINT ToUINT( void );

Description

Returns the value of the current CStr object as an  unsigned integer or 0 if CStr doesn' t correspond to a number.

Example

int iValue = 125, iTest = 0;

CStr szMsg;

szMsg.From( (int)iValue );

iTest = (int)szMsg.ToUINT();

szMsg.From( (int)iTest );

szMsg.MB();

See also...

From

ToInt

ToLong

ToULong

ToFloat

ToDouble

ToTime

Round

IsDigit

IsInRange


ToLong

signed long ToLong( void );

Description

Returns the value of the current CStr object as a signed long or 0L if CStr doesn' t correspond to a number.

Example

long LValue = 125000L, LTest = 0;

CStr szMsg;

szMsg.From( (long)LValue );

LTest = szMsg.ToLong();

szMsg.From( (long)LTest );

szMsg.MB();

See also...

From

ToInt

ToUINT

ToULong

ToFloat

ToDouble

ToTime

Round

IsDigit

IsInRange


ToULong

unsigned long ToULong( void );

Description

Returns the value of the current CStr object as an unsigned long or 0L if CStr doesn' t correspond to a number.

Example

unsigned long LValue = 125000L, LTest = 0;

CStr szMsg;

szMsg.From( (unsigned long)LValue );

LTest = szMsg.ToULong();

szMsg.From( (unsigned long)LTest );

szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToFloat

ToDouble

ToTime

Round

IsDigit

IsInRange


ToFloat

float ToFloat( void );

Description

Returns the value of the current CStr object as a float or 0 if CStr doesn' t correspond to a number.

Example

float FValue = 125.382, LTest = 0;

CStr szMsg;

szMsg.From( (double)FValue );

FTest = szMsg.ToFloat();

szMsg.From( (double)FTest );

szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToULong

ToDouble

ToTime

Round

IsDigit

IsInRange


ToDouble

double ToDouble( void );

Description

Returns the value of the current CStr object as a double or 0 if CStr doesn' t correspond to a number.

Example

double DValue = 125.382, DTest = 0;

CStr szMsg;

szMsg.From( (double)DValue );

DTest = szMsg.ToDouble();

szMsg.From( (double)DTest );

szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToULong

ToFloat

ToTime

Round

IsDigit

IsInRange


ToTime

CTime ToTime( LPCSTR szFilter = "D/M/Y" );

Description

Returns the value of the current CStr object as a CTime object using  <szFilter>.

Example

CTime TheTime;

CStr szTest("12/01/94");

TheTime = szTest.ToTime();

See also...

From

FromCurrentTime

FromFileTime


Delete

CStr Delete( unsigned PFirst = 0, unsigned PLength = 0 );

Description

Deletes a piece of a string starting with <PFirst> and with the <PLength> length. <PFirst begin> is 0 indexed. CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("0123456789");

szMsg.Delete(2,3);

szMsg.MB();

See also...

Replace

Insert

Extract

Blank


Replace

CStr Replace( LPCSTR szOld, LPCSTR szNew = "" );

CStr Replace( char szOld, char szNew  );

Description

Replaces all substrings <szOld> of the current CStr object  with <szNew>.  If you use LPCSTR, <szOld> and <szNew> can have different lengths, otherwise they must correspond to a character. CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("ABABAB");

szMsg.Replace( "AB", "C");

szMsg.MB();

See also...

Count

Delete

Insert

Extract

operator[]


Insert

CStr Insert( LPCSTR szSub, int Pos  = 0 );

CStr Insert( char szSub, int Pos  = 0 );

Description

Inserts the string <szSub> or the char <szSub> in the cuurent CStr object at position <Pos> ( 0 indexed ).

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("ABABAB");

szMsg.Insert( "00", 3);

szMsg.MB();

See also...

Delete

Replace

Extract

operator[]


Extract

CStr Extract( int Pos = 1, LPCSTR szDelimit = "\t" );

CStr Extract( int Pos, char szDelimit );

Description

Extracts an item of the current CStr object using the <szDelimit> string as an item separator. <szDelimit> must be 1 character length if you use the LPCSTR version. <Pos> is the item number you wish to extract ( 1 indexed ). Before you call this function, you must use Find or Count to avoid GPF!

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("ITEM1\tITEM2");

if ( szMsg.Count('\t') )

  {

  szMsg.Extract(2);

  szMsg.MB();

  }

See also...

Count

Delete

Replace

Insert

operator[]


operator[]

char& operator[](int Index );

Description

You can use this operator like you do with the CString SetAt function. Of course, the character specified with <index> ( 0 indexed ) must be available ( ie. in the string )!

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("0123456789");

szMsg[0] = 'A';

szMsg.MB();

See also...

Replace

Insert

Extract

FirstUpper


GetBuffer

virtual LPSTR CStr::GetBuffer( int size = 0);

Description

Same as the CString function, but, if you don' t specify a <size>, GetBuffer will use the current object size or 255 if this one is 0.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

lstrcpy( szMsg.GetBuffer(), "TEST" );

szMsg.ReleaseBuffer();

szMsg.MB();

See also...

operator[]


Round

CStr Round( void );

Description

Rounds the current CStr object ( which indicates a number ) to the next integer.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

szMsg.From((float)123.236);

szMsg.Round();

szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToULong

ToFloat

ToDouble

IsDigit

IsInRange


FirstUpper

CStr FirstUpper( void );

Description

Changes the first character into uppercase.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("abcde AAAA");

szMsg.FirstUpper();

szMsg.MB();

See also...

operator[]


AddLF

CStr AddLF( void );

Description

Adds a Carriage return and a line feed to the current CStr object.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("abcde AAAA");

szMsg.AddLF();

szMsg.ToFile("C:\\TRACE.LOG");


Blank

CStr Blank( void );

Description

Fills the current string with blanks characters ( spaces ) using the original string length ( so the string length stay the same ).

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg("abcde AAAA");

szMsg.Blank();

See also...

operator[]

AddLF

Replicate


Replicate

CStr Replicate( char cPattern = ' ', int iLen = 1 );

Description

Creates a string with the character  <cPattern> and the length <iLen> ( but it' s not a constructor! ). The string is filled with <cPattern>.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

szMsg.Replicate('.',25);

szMsg.MB();

See also...

Insert

operator[]

Blank


CheckSize

CStr CheckSize( int iLength = 255, BOOL bAddPoints = TRUE );

Description

Checks the size of the current CStr object, and, if the length of the string is higher than <iLength>, this

function will truncate the string and add '...' if <bAddPoints> is set to TRUE. This function is quite useful to use before you put values in Static controls.

CHANGES THE CURRENT CSTR OBJECT.

Example

Cstr szMsg;

szMsg.FromIni("General","FirstName","C:\\MYAPP\\MYAPP.INI");

szMsg.CheckSize( 25 );

szMsg.ToCtl( this, IDC_STATICFNAME );

See also...

Delete

Extract

FirstUpper

CheckDirSize

FromCtl

ToCtl


CheckDirSize

CStr CheckDirSize( int iLength = 60, BOOL bShift = TRUE );

Description

Checks the size of the current CStr object, and, if the length of the string is higher than <iLength>, this

function will truncate the string and will try to keep the drive and the last dir or file name. So, in case some dirs are too long to be conserved, they will be replaced by '...'. If <bShift> is TRUE, the string will be converted to uppercase. This function is quite useful to use before you put values in Static controls.

CHANGES THE CURRENT CSTR OBJECT.

Example

Cstr szMsg;

szMsg.FromIni("General","AppPath","C:\\MYAPP\\MYAPP.INI");

szMsg.CheckDirSize( 80 );

szMsg.ToCtl( this, IDC_APPPATH );

See also...

Delete

Extract

FirstUpper

CheckSize

FromCtl

ToCtl


IsDigit

BOOL IsDigit( void );

Description

Returns TRUE is the current CStr object corresponds to a number, ie. all characters are numbers or inside [ '.', ',', '-' and ' '].

Example

Cstr szMsg("123,024.23");

if ( szMsg.IsDigit() )

  szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToULong

ToFloat

ToDouble

Round

IsInRange

FromCtl


IsInRange

BOOL IsInRange( double dMini = 0, double dMaxi  = 100);

Description

Returns TRUE if the current number specified by the current CStr object is higher or equal to

<dMini> and lower or equal to <dMaxi>.In many cases you must use IsDigit before this function.

Example

Cstr szMsg("99.23");

if ( szMsg.IsInrange(50,100) )

  szMsg.MB();

See also...

From

ToInt

ToUINT

ToLong

ToULong

ToFloat

ToDouble

Round

IsDigit

CheckSize

FromCtl


FromIni

CStr FromIni( LPCSTR szSection, LPCSTR szKey, LPCSTR szFile = NULL, int iSize = 512 );

Description

Reads a value in the <szFile> INI File, or if this one is set to NULL, in WIN.INI. Also looks at the <szSection> section ("[...]"), at the <szKey> Key ( "XXX=" ) and reads <iSize> characters. If this key is not defined, the	current CStr will contain "". See GetProfileString documentation for more informations.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szIniValue;

szIniValue.FromIni("MyApp","UserName");

szIniValue.MB();

See also...

From

ToIni

FromFile


ToIni

void ToIni( LPCSTR szSection, LPCSTR szKey, LPCSTR szFile = NULL );

Description

Write the current CStr object into an INI file. This INI file is <szFile>, or, if this value is NULL, the WIN.INI

file will be used. Also this function will use the <szSection> section and the <szKey> key. See WriteProfileString documentation for more informations.

Example

CStr szIniValue("MyName");

szIniValue.ToIni("MyApp","UserName");

See also...

FromIni

ToFile


FromFile

CStr FromFile( LPCSTR szFile, BOOL bKeepString = FALSE, BOOL bAddPoints = TRUE );

Description

Reads the file <szFile> and puts its content into the current CStr object. If <bKeepString> is set to TRUE, the file content will be appended to the current CStr. This function can read up to 32700 characters and if there are more than 32700 characters in the string or file, if  <bAddPoints> is TRUE, the function will add "..." to the string.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szFileList;

szFileList.FromFile("C:\\MYAPP\\MYLIST.DAT");

szFileList.MB();

See also...

From

FromFileTime

AddLF

FromIni

ToFile


ToFile

BOOL ToFile( LPCSTR szFile, BOOL bAppend = TRUE );

Description

Writes the current CStr object into the file <szFile>. If <bAppend> is TRUE, the string will be appended to the file, otherwise, the file will be deleted. Returns TRUE if successful, FALSE if not.

Example

CStr szFileList;

szFileList = "Line1";

szFileList.AddLF();

szFileList += "Line2";

szFileList.AddLF();

szFileList.ToFile("C:\\MYAPP\\MYLIST.DAT", FALSE);

See also...

AddLF

ToIni

FromFile


FromCtl

CStr FromCtl( CWnd* pWnd, int iCtl );

Description

Reads the text value, or the current selected value, of control <iCtl> of the window ( or dialog box ) <pWnd>. In many cases, <pWnd> is the local pointer 'this'. This function doesn' t support multiple

selection listboxes.

CHANGES THE CURRENT CSTR OBJECT.

Example

CStr szMsg;

szMsg.FromCtl( this, IDC_VALUE1 );

szMsg.MB();

See also...

From

FirstUpper

ToCtl


ToCtl

void ToCtl( CWnd* pWnd, int iCtl, BOOL bAltMode = FALSE );

Description

Puts the current CStr string into the Windows control <iCtl> of the Window ( or Dialog box ) <pWnd>.

In many cases, <pWnd> is the local pointer 'this'. This function supports all Windows controls. In case of a ComboBox or a ListBox, the string will be appended to the end of the list without any sorting or, if you set <bAltMode> to TRUE, this value will be appended with a sorting process if this one is available.

Example

CStr szMsg("Value...");

szMsg.ToCtl( this, IDC_VALUE1 );

See also...

FirstUpper

CheckDirSize

CheckSize

FromCtl


MB

int MB( CWnd* pWnd = NULL, LPCSTR szTitle = NULL, UINT mbType = MB_OK | MB_ICONINFORMATION );

Description

Shows a message box using the current CStr value. <pWnd> indicates the parent Window to use ( "this" ) and it can be NULL.  <szTitle> is the  title of the message box and <mbType> the type of this message

box ( see "MessageBox"  SDK documentation for a list of possible types ). This function is useful because you can call it without any parameter.

Example

CStr szMsg("Test");

szMsg.MB();

See also...

FirstUpper